<?php
class loggingAction extends galaxyAction{
		public function index() {
			$this->display();
		}
		public function login() {
			if($_ENV['g']->uid>0) $this->showMessage(L('login_success'), U('home/'));
			$this->checksubmit();
			gUser::login();
			if(strpos($_POST['referer'], U('logging/')) != -1) unset($_POST['referer']);
			$fwd = $_GET['ajax'] ? 'javascript:location.reload();' : ($_POST['referer']?$_POST['referer']:U('home/'));
			$this->showMessage(L('login_success'), $fwd);
		}
		public function logout() {
			gUser::logout();
			$this->showMessage('logout_success', $_GET['ajax'] ? 'javascript:location.reload();' :U('home/'));
		}
}
?>